﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;

namespace Digitalmes.Model.ProductionManagement
{
    /// <summary>
    /// 批次物料投料记录
    /// </summary>
	[Table("ProductionBatchMaterialRecord")]

    [Display(Name = "_Model.ProdBatchMaterialRecord")]
    public class ProductionBatchMaterialRecord : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._ProdBatchMaterialRecord._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._MaterialCode")]
        [Comment("物料编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string MaterialCode { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._Barcode")]
        [Comment("物料条码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Barcode { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._Wo")]
        [Comment("归属工单")]
        public string Wo { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._Qty")]
        [Comment("当前批次数量")]
        [Precision(18,2)]
        public decimal? Qty { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._UsedQty")]
        [Comment("已使用数量")]
        [Precision(18,2)]
        public decimal? UsedQty { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._LineId")]
        [Comment("产线 Id")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._LineCode")]
        [Comment("产线编号")]
        public string LineCode { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._OpId")]
        [Comment("工位号")]
        public long? OpId { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._OpCode")]
        [Comment("用料工序编号")]
        public string OpCode { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._FeedingTime")]
        [Comment("上料时间")]
        public DateTime? FeedingTime { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._ScanOpId")]
        [Comment("扫码工位 Id")]
        public long? ScanOpId { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._ScanOpCode")]
        [Comment("扫码工位编号")]
        public string ScanOpCode { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._FeedingBy")]
        [Comment("投料人")]
        public string FeedingBy { get; set; }
        [Display(Name = "_Model._ProdBatchMaterialRecord._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
